package com.ftx.controller.test.annotation.beans;

import com.ftx.controller.test.annotation.MainConfig;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by fengtingxin on 2020/4/15.
 */
public class IOCTEST_LifeCycle {



    @Test
    public void testImport(){
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigBeans.class);
        System.out.println("容器创建完成");

        Object o = applicationContext.getBean("car");
        applicationContext.destroy();
        System.out.println("容器销毁完成");


    }
}
